package com.uva.pgpi.sgcc.beans;

import java.io.Serializable;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

@DatabaseTable(tableName = "roles")
public class Rol implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -834365063776869510L;
	public static final String ID_ROL = "idRol";
	public static final String ROL = "descripcion";

	@DatabaseField(generatedId = true, columnName = ID_ROL)
	private int idRol;

	@DatabaseField(columnName = ROL, unique = true, canBeNull = false)
	private String descripcion;

	public Rol() {
	}

	public Rol(String desc) {
		this.setDescripcion(desc);
	}

	public Rol(int id, String desc) {
		this.setIdRol(id);
		this.setDescripcion(desc);
	}

	public String getDescripcion() {
		return descripcion;
	}

	public int getIdRol() {
		return idRol;
	}

	public void setDescripcion(String descripcion) {
		this.descripcion = descripcion;
	}

	public void setIdRol(int idRol) {
		this.idRol = idRol;
	}

	@Override
	public String toString() {
		return this.getIdRol() + " - " + this.getDescripcion();
	}

	public static void main(String[] args) {
		System.out.println(new Rol("Jefe"));
	}
}
